import React, { Component } from 'react';
import Login from "./components/login/login"
import Header from "./views/header/header"
import Find from "./views/findmusic/Findmusic"
import { HashRouter,Route, Redirect } from "react-router-dom"
import './App.css';
import './main.scss'

class App extends Component {
  constructor() {
    super()
    this.state = {
      showLogin:false,
      type:"手机"
    }
  }
  loginFn =(type,flag) => {
    this.setState({
      showLogin:flag,
      type:type
    })
  }
  render() {
    return (
      <HashRouter>
        <div className="App">
          <Header loginFn={this.loginFn}></Header>
          { this.state.showLogin ? <Login loginFn={this.loginFn} type={this.state.type}></Login> :'' }
          <Route path="/find" component={Find} ></Route>
          
        </div>
      </HashRouter>
      
    );
  }
}

export default App;
